<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>门店列表</title> 
    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.0.0" rel="stylesheet">
    <link href="/public/static/admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <base target="_blank">
    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/public/static/admin/js/plugins/layer/layer.min.js"></script>

    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/js/contabs.js"></script>
    <script src="/public/static/admin/js/common.js"></script>
    <script src="/public/static/admin/js/article.js"></script>
    <script src="/public/static/admin/js/myAjax.js"></script>

    <!-- Bootstrap table -->
    <script src="/public/static/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/public/static/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/public/static/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>    
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>门店列表</h5>
                    <div class="ibox-tools" style="display:none;">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="table_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="table_basic.html#">选项1</a>
                            </li>
                            <li><a href="table_basic.html#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-header">
                                    <div class="panel-body">
                                            <div>
                                            <form id="formSearch" class="form-horizontal form-inline">
                                                <!-- <label class="control-label">城市分类：</label>
                                                <select class="form-control" name="kind_id">
                                                    <option value="">所有分类</option>
                                                    <foreach name="cat_select" item="cat">
                                                        <option value="{$cat.id}">{$cat.title}</option>
                                                    </foreach>
                                                </select> -->
                                                <label class="control-label">关键字：</label>
                                                <input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
                                                <button type="button" style="margin-left:30px" onclick="getAjaxList('ajaxList',1,'/index.php/Admin/Shop/ajax_shop_list')" id="btn_query" class="btn btn-primary">查询</button>
                                                
                                                <a onclick="window.location.href=location.href;" href="javascript:;" class="btn btn-primary pull-right" ><i class="glyphicon glyphicon-refresh"></i>刷新</a>
                                                <a onclick="openYemian('/index.php/Admin/Shop/shop_add','添加门店')" href="javascript:;" class="btn btn-primary pull-right" style="margin-right:10px;"><i class="fa fa-plus"></i>添加</a>
                                            </form>
                                            </div>
                                    </div>                  
                                </div><!-- /.box-header -->
                                <div class="box-body">
                                    <div class="row">
                                        <div class="col-sm-12">
                                            <div id="ajaxList"></div>
                                        </div>
                                    </div>
                                </div> <!-- /.box-body -->
                           </div><!-- /.box -->
                        </div>
                   </div>
                </div>
            </div>
        </div>
    </div> 
</div>
<input id="handle_status" value="" hidden="hidden">
<script>
function delRecord(obj,name,id,url) {
    top.layer.confirm(name,{
        icon : 3,
        btn:['确定','取消'],
    } , function(){
        $.ajax({
            url : url,
            type : "post",
            data : {id:id,act:'del'},
            dataType : "json",
            success:function(data){
                if (data.status == 0) { 
                    top.layer.msg(data.message);
                } else {
                    top.layer.msg(data.message);
                    $(obj).parent().parent().remove();
                }
            }
        });
    } , function(){
        layer.close(); //再执行关闭 
    })
}
    // getAjaxList('ajaxList',1,'/index.php/Admin/Shop/ajax_shop_list');
    $(document).ready(function(){
        ajax_get_table('formSearch',1);
    });

    function ajax_get_table(tab,page){
        cur_page = page; //当前页面 保存为全局变量
        $.ajax({
            type : "POST",
            url:"/index.php/Admin/Shop/ajax_shop_list/p/"+page,
            data : $('#'+tab).serialize(),
            success: function(data){
                $("#ajaxList").html('');
                $("#ajaxList").append(data);
            }
        });
    }
</script>

</body>

</html>